import { App } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import routes from '../../routes'
import guard from './guard'
const router = createRouter({
   routes: [
      {
         name: 'index',
         path: '/',
         redirect: '/tabber/home',
         component: () => import('../../views/home.vue'),
         children: [...routes]
      }
   ],
   history: createWebHashHistory()
})

guard(router)

export default router
export const setUp = (app: App) => {
   app.use(router)
}
